package models;



public class BeanDtoInfoImpl implements BeanDtoInfo {

	private static final long serialVersionUID = 3335794639322076878L;

	protected Integer id;
	
	protected String dtoName;
	
	@Override
	public Integer getId() {
		return id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public void setDtoName(String name){
		dtoName = name;
	}
	
	@Override
	public String getDtoName(){
		return getClass().getSimpleName();
	}
	
	@Override
	public String toString(){
		return "dto:["  + getDtoName() + ":" + getId() + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((getDtoName() == null) ? 0 : getDtoName().hashCode());
		result = prime * result + getId();
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BeanDtoInfoImpl other = (BeanDtoInfoImpl) obj;
		if (getDtoName() == null) {
			if (other.getDtoName() != null)
				return false;
		} else if (!getDtoName().equals(other.getDtoName()))
			return false;
		if (getId() != other.getId())
			return false;
		return true;
	}

}
